


uint8_t gsmc_init(void);
uint8_t gsmc_match(uint8_t* rec_msg, uint16_t rec_msg_len);
uint8_t gsmc_send(uint8_t *msg, uint16_t msg_len, 
					uint16_t delay_time_tick,
					uint16_t blocking_time_tick,
					uint16_t matching_time_tick,
					uint8_t max_repeat);

#define send_data_1 "send data 1"

void main()
{
	uint8_t rec_data[128];
	uint8_t rec_len = 0;

	if(gsmc_init() == 0){
		LOGINFO0(UART_DEBUG, "gsmc_init fail!!\n");
	}

	while (1){
		gsmc_send(send_data_1, sizeof(send_data_1), 
					1, 10, 30, 5);
		if(read_rec_buff(rec_data, rec_len)){
			if(1 == gsmc_match(rec_data, rec_len))
			{
				//??
			}
		}
	}
	
}

/**************************************************************************/
void gsmc_send_hook(uint8_t *msg, uint16_t msg_len)
{
	printf("send msg %s!!\n", msg);
	send(msg, msg_len);
}

void gsmc_timeout_hook(uint8_t *msg, uint16_t msg_len)
{
	printf("send msg %s fail!!\n", msg);
}

uint8_t gsmc_match_hook(uint8_t* rec_msg, uint16_t rec_msg_len, 
								uint8_t* match_msg, uint16_t match_msg_len)
{
	if(strcmp(rec_msg, match_msg) == 0){
		printf("send msg %s success\n", msg);
		return 1;
	}
	else{
		return 0;
	}
}